package view;

import java.util.LinkedHashMap;

import controleur.Config;
import controleur.GameControleur;
import controleur.eMenuOption;

@SuppressWarnings("serial")
public class ColorChoiserView extends MenuView
{

	private static final String[] conf_desc;
	private static final Config[] conf;
	private static final LinkedHashMap<String, eMenuOption> menuOpt;
	private final GameControleur controleur;
	private final eMenuOption valeurRetour;
	
	static
	{
		int size = 3;
		conf_desc = new String[size];
		conf = new Config[size];
		
		conf_desc[0] = "Normal";
		conf[0] = Config.defaultCfg;
		conf_desc[1] = "Noir et blanc";
		conf[1] = Config.whiteAndBlack;
		conf_desc[2] = "Jaune et bleu";
		conf[2] = Config.yellowAndBlue;   
	
		menuOpt = new LinkedHashMap<String, eMenuOption>();
		for(int i = 0 ; i < conf.length ; i++)
			menuOpt.put(conf_desc[i], eMenuOption.rien);
		
	}
	



	public ColorChoiserView(eMenuOption valeurRetour, GameControleur c)
	{
		super("Choix des couleurs", "Choisissez un theme de couleur", menuOpt, c, c.cfg);
		this.valeurRetour = valeurRetour;
		this.controleur = c;
	}

	
	@Override
	protected void lancerOption(int i)
	{
		this.controleur.cfg = conf[i];
		this.lancerOption(this.valeurRetour);
	}
}
